package com.deliinsns.app.student;
import java.util.List;
import org.springframework.util.CollectionUtils;
import com.deliinsns.app.student.bean.Student;
import com.deliinsns.sys.BasicDao;
public class StudentDao extends BasicDao<Student> {

	public Student getByUsername(String name) {
		 Student student= null;
		 List<Student> list= this.findByHql("from Student t where t.username =?",name);
		 if(!CollectionUtils.isEmpty(list)){
			 student=  list.get(0);
		 }
		 return student;
	}
	public Student getById(String id) {
		return this.get(Student.class, id);
	}
}
